<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Reflection::Repository</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>

  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (R)</a> &raquo; 
    <a title="Reflection" href="../Reflection.html">Reflection</a>
     &raquo; 
    <span class="title">Repository</span>
  
</div>

      <div id="search">
  <a id="class_list_link" href="#">Namespace List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Reflection::Repository 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">lib/reflection/repository.rb</dd>
  
</dl>
<div class="clear"></div>



  <h2>Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature"><a title="#path (instance method)" href="#path-instance_method">- (Object) <strong>path</strong> </a>
  
  </span>
  
    
    
  
  
  
  

  
    <span class="summary_desc">
Returns the value of attribute <tt>path</tt>.

</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#url (instance method)" href="#url-instance_method">- (Object) <strong>url</strong> </a>
  
  </span>
  
    
    
  
  
  
  

  
    <span class="summary_desc">
Returns the value of attribute <tt>url</tt>.

</span>
  
</li>

    
  </ul>


  <h2>Method Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature"><a title="exists? (class method)" href="#exists%3F-class_method">+ (Object) <strong>exists?</strong>(path) </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="new_from_path (class method)" href="#new_from_path-class_method">+ (Object) <strong>new_from_path</strong>(path) </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#clone (instance method)" href="#clone-instance_method">- (Object) <strong>clone</strong>(path) </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#commit_all_new_files (instance method)" href="#commit_all_new_files-instance_method">- (Object) <strong>commit_all_new_files</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#identifier (instance method)" href="#identifier-instance_method">- (Object) <strong>identifier</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#initialize (instance method)" href="#initialize-instance_method">- (Repository) <strong>initialize</strong>(new_url, path = nil) </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc">
A new instance of <tt>Repository</tt>.

</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#pull (instance method)" href="#pull-instance_method">- (Object) <strong>pull</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#push (instance method)" href="#push-instance_method">- (Object) <strong>push</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#reset! (instance method)" href="#reset%21-instance_method">- (Object) <strong>reset!</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#same_in_path? (instance method)" href="#same_in_path%3F-instance_method">- (Object) <strong>same_in_path?</strong>(path) </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
  </ul>

<div id="constructor_details">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a title="Repository" href="">Repository</a></tt>) <strong>initialize</strong>(new_url, path = nil) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
A new instance of <tt>Repository</tt>
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a title="Repository" href="">Repository</a></tt>)</span>
      
      
      
      
        &mdash;
        
a new instance of <tt>Repository</tt>


      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


27
28
29
30</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 27</span>

<span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='new_url identifier id'>new_url</span><span class='comma token'>,</span> <span class='path identifier id'>path</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span><span class='rparen token'>)</span>
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='url identifier id'>url</span> <span class='assign token'>=</span> <span class='new_url identifier id'>new_url</span>
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span> <span class='assign token'>=</span> <span class='path identifier id'>path</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="attr_details">
    <h2>Attribute Details</h2>
    
      
      <span id="path=-instance_method"></span>
      <span id="path-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="path-instance_method">
  
    - (<tt>Object</tt>) <strong>path</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute <tt>path</tt>
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


8
9
10</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 8</span>

<span class='def def kw'>def</span> <span class='path identifier id'>path</span>
  <span class='@path ivar id'>@path</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="url=-instance_method"></span>
      <span id="url-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="url-instance_method">
  
    - (<tt>Object</tt>) <strong>url</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute <tt>url</tt>
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


7
8
9</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 7</span>

<span class='def def kw'>def</span> <span class='url identifier id'>url</span>
  <span class='@url ivar id'>@url</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="method_details">
    <h2>Method Details</h2>
    
      <div class="method_details first">
  <p class="signature first" id="exists?-class_method">
  
    + (<tt>Object</tt>) <strong>exists?</strong>(path) 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


19
20
21
22
23
24
25</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 19</span>

<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exists? fid id'>exists?</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='begin begin kw'>begin</span>
    <span class='Git constant id'>Git</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='rescue rescue kw'>rescue</span> <span class='ArgumentError constant id'>ArgumentError</span>
    <span class='return return kw'>return</span> <span class='false false kw'>false</span>
  <span class='end end kw'>end</span>      
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="new_from_path-class_method">
  
    + (<tt>Object</tt>) <strong>new_from_path</strong>(path) 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12
13
14
15
16
17</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 10</span>

<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='new_from_path identifier id'>new_from_path</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='unless unless kw'>unless</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exists? fid id'>exists?</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
    <span class='raise identifier id'>raise</span> <span class='dstring node'>&quot;'#{path}' is not a valid Git repository&quot;</span>
  <span class='end end kw'>end</span>
  
  <span class='repo identifier id'>repo</span> <span class='assign token'>=</span> <span class='Git constant id'>Git</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='repo identifier id'>repo</span><span class='dot token'>.</span><span class='remote identifier id'>remote</span><span class='dot token'>.</span><span class='url identifier id'>url</span><span class='comma token'>,</span> <span class='path identifier id'>path</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="clone-instance_method">
  
    - (<tt>Object</tt>) <strong>clone</strong>(path) 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


47
48
49</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 47</span>

<span class='def def kw'>def</span> <span class='clone identifier id'>clone</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='Git constant id'>Git</span><span class='dot token'>.</span><span class='clone identifier id'>clone</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='url identifier id'>url</span><span class='comma token'>,</span> <span class='path identifier id'>path</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="commit_all_new_files-instance_method">
  
    - (<tt>Object</tt>) <strong>commit_all_new_files</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


51
52
53
54
55
56</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 51</span>

<span class='def def kw'>def</span> <span class='commit_all_new_files identifier id'>commit_all_new_files</span>
  <span class='repo identifier id'>repo</span> <span class='assign token'>=</span> <span class='Git constant id'>Git</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span> <span class='string val'>&quot;Committing all changes..&quot;</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span><span class='lparen token'>(</span><span class='repo identifier id'>repo</span><span class='dot token'>.</span><span class='add identifier id'>add</span><span class='rparen token'>)</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span><span class='lparen token'>(</span><span class='repo identifier id'>repo</span><span class='dot token'>.</span><span class='commit_all identifier id'>commit_all</span><span class='lparen token'>(</span><span class='string val'>&quot;Updated stash.&quot;</span><span class='rparen token'>)</span><span class='rparen token'>)</span> <span class='rescue rescue kw'>rescue</span> <span class='true true kw'>true</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="identifier-instance_method">
  
    - (<tt>Object</tt>) <strong>identifier</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 32</span>

<span class='def def kw'>def</span> <span class='identifier identifier id'>identifier</span>
  <span class='Digest constant id'>Digest</span><span class='colon2 op'>::</span><span class='MD5 constant id'>MD5</span><span class='dot token'>.</span><span class='hexdigest identifier id'>hexdigest</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='url identifier id'>url</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="pull-instance_method">
  
    - (<tt>Object</tt>) <strong>pull</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66
67
68</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 64</span>

<span class='def def kw'>def</span> <span class='pull identifier id'>pull</span>
  <span class='repo identifier id'>repo</span> <span class='assign token'>=</span> <span class='Git constant id'>Git</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span> <span class='string val'>&quot;Pulling..&quot;</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span><span class='lparen token'>(</span><span class='repo identifier id'>repo</span><span class='dot token'>.</span><span class='pull identifier id'>pull</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="push-instance_method">
  
    - (<tt>Object</tt>) <strong>push</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


58
59
60
61
62</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 58</span>

<span class='def def kw'>def</span> <span class='push identifier id'>push</span>
  <span class='repo identifier id'>repo</span> <span class='assign token'>=</span> <span class='Git constant id'>Git</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span> <span class='string val'>&quot;Pushing commit..&quot;</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span><span class='lparen token'>(</span><span class='repo identifier id'>repo</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="reset!-instance_method">
  
    - (<tt>Object</tt>) <strong>reset!</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


41
42
43
44
45</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 41</span>

<span class='def def kw'>def</span> <span class='reset! fid id'>reset!</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span> <span class='string val'>&quot;Resetting target to HEAD&quot;</span>
  <span class='repo identifier id'>repo</span> <span class='assign token'>=</span> <span class='Git constant id'>Git</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='repo identifier id'>repo</span><span class='dot token'>.</span><span class='reset_hard identifier id'>reset_hard</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="same_in_path?-instance_method">
  
    - (<tt>Object</tt>) <strong>same_in_path?</strong>(path) 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


36
37
38
39</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/repository.rb', line 36</span>

<span class='def def kw'>def</span> <span class='same_in_path? fid id'>same_in_path?</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='git_repo identifier id'>git_repo</span> <span class='assign token'>=</span> <span class='Git constant id'>Git</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
  <span class='lparen token'>(</span><span class='git_repo identifier id'>git_repo</span><span class='dot token'>.</span><span class='remote identifier id'>remote</span> <span class='andop op'>&amp;&amp;</span> <span class='git_repo identifier id'>git_repo</span><span class='dot token'>.</span><span class='remote identifier id'>remote</span><span class='dot token'>.</span><span class='url identifier id'>url</span> <span class='eq op'>==</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='url identifier id'>url</span><span class='rparen token'>)</span> <span class='orop op'>||</span> <span class='false false kw'>false</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Wed Nov 18 18:17:11 2009 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
  0.4.0 (ruby-1.8.7).
</div>

  </body>
</html>